package pl.minim.unidefCMS.objects {
	import com.googlecode.milib.util.MLStringUtil;			

	/**
	 * @author Marek Brun
	 */
	public class UnidefDate extends AbstractUnidefObject {
		
		public var date:Date=new Date();
		public var min:Date;
		public var max:Date;

		public function UnidefDate() {
			
		}
		
		override public function getTypeName():String {
			return 'Date';
		}
		
		override public function getDataAsTextPreview():String {
			return MLStringUtil.formatDateDDMMYYYY(date);
		}
		
		override public function toXML():XML {
			var xml:XML=<i/>;
			xml.appendChild(String(date.getTime()));
			return xml;
		}
		
		override public function exportToRawData():* {
			return new Date(date.time);
		}
		
	}
}
